home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / FL32 / OEMSETUP.INF < prev   
INI File  |  1996-07-31  |  48KB  |  1,619 lines

  1. /***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Intel Flash32 network card and driver SETUP INF file.
  6. ;               For Intel FLASH 32 Miniport Driver (FL32MINI.SYS)
  7. ;               $Revision:   1.1  $
  8. ;***********************************************************************
  9.  
  10. ;-----------------------------------------------------------------------
  11. ; OPTION TYPE
  12. ; -----------
  13. ; This identifies the Option type we are dealing with.  The different
  14. ; possible types are:
  15. ;
  16. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  17. ;
  18. ;  Types specific to networking:
  19. ;
  20. ; NetAdapter,        a netcard / adapter combination or just a netcard
  21. ; NetDriver,         just a netcard driver
  22. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  23. ; NetService,        an NT networking service
  24. ; NetWork,           a complete network ensemble.
  25. ; NetProvider        a complete network which supports NT MPR protocol
  26. ;-----------------------------------------------------------------------
  27.  
  28. [Identification]
  29.     OptionType = NetAdapter
  30.  
  31. ;-----------------------------------------------------------------------
  32. ; PlatformsSupported
  33. ; ------------------
  34. ; This identifies the platforms supported by the adapter card.
  35. ; Possible types are:
  36. ;
  37. ; ISA, EISA and MCA
  38. ;-----------------------------------------------------------------------
  39.  
  40. [PlatformsSupported]
  41.     EISA
  42.     "Jazz-Internal Bus"
  43.  
  44. ;-----------------------------------------------------------------------
  45. ; LANGUAGES SUPPORTED
  46. ; -------------------
  47. ;
  48. ; The languages supported by the OEM INF, For every language supported
  49. ; we need to have a separate text section for every displayable text
  50. ; section.
  51. ;
  52. ;-----------------------------------------------------------------------
  53.  
  54. [LanguagesSupported]
  55.     ENG
  56.  
  57. ;-----------------------------------------------------------------------
  58. ; OPTION LIST
  59. ; -----------
  60. ; This section lists the OEM Option key names.  These keys are locale
  61. ; independent and used to represent the option in a locale independent
  62. ; manner.
  63. ;
  64. ;-----------------------------------------------------------------------
  65.  
  66. [Options]
  67.     FL32
  68.  
  69. ;-----------------------------------------------------------------------
  70. ; OPTION TEXT SECTION
  71. ; -------------------
  72. ; These are text strings used to identify the option to the user.  There
  73. ; are separate sections for each language supported.  The format of the
  74. ; section name is "OptionsText" concatenated with the Language represented
  75. ; by the section.
  76. ;
  77. ;-----------------------------------------------------------------------
  78.  
  79. [OptionsTextENG]
  80.     FL32 = "Intel Flash32 EISA LAN Adapter (Miniport)"
  81.  
  82. [Files-Inf]
  83. 1, oemsetup.inf, SIZE=50000, RENAME=$(!UG_Filename)
  84.  
  85. [Files-AUX]
  86. 1,FL32NT.DLL, SIZE=65535
  87. 1,FL32NT.HLP, SIZE=65535
  88.  
  89. [Files-FL32]
  90. 1, FL32MINI.SYS, SIZE=65535
  91.  
  92. ;***********************************************************************
  93. ; CONSTANTS FOR USING DIALOGS
  94. ;***********************************************************************
  95.  
  96. [FileConstants]
  97. ;
  98. ;  File names, etc.
  99. ;
  100. UtilityInf      = "UTILITY.INF"
  101. subroutineinf   = "SUBROUTN.INF"
  102. SoftwareType    = "driver"
  103. Exit_Code       = 0
  104.  
  105. ;
  106. ; EventLog Message File
  107. ;
  108. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  109. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  110.  
  111. ;
  112. ; Product Info
  113. ;
  114. Manufacturer        =  "Intel"
  115. ProductMajorVersion = "3"
  116. ProductMinorVersion = "1"
  117. ProductVersion      = $(ProductMajorVersion)"."$(ProductMinorVersion)
  118.  
  119. ;
  120. ; Software
  121. ;
  122. ProductSoftwareName     = "FL32"
  123. ProductSoftwareTitle    = "Intel Flash32 LAN Adapter Driver"
  124. ProductSoftwareImagePath = "%SystemRoot%\System32\drivers\FL32mini.sys"
  125. NetRuleSoftwareType     = "FL32Sys ndisDriver FL32Driver"
  126. NetRuleSoftwareUse      = $(SoftwareType)
  127. NetRuleSoftwareBindForm = """FL32Sys"" yes no container"
  128. NetRuleSoftwareClass    = {"FL32Driver basic"}
  129. NetRuleSoftwareBindable = {"FL32Driver FL32Adapter non exclusive 100"}
  130.  
  131. ;
  132. ; Hardware
  133. ;
  134. ProductHardwareName     = "FL32"
  135. ProductHardwareTitle    = "Intel Flash32 Adapter [Miniport]"
  136. NetRuleHardwareType     = "FL32 FL32Adapter"
  137. NetRuleHardwareBindForm = " yes yes container"
  138. NetRuleHardwareClass    = {"FL32Adapter basic"}
  139.  
  140. ;
  141. ;  EISA System ID Info
  142. ;
  143. NETCARD_ID      = 1102885           ; Flash32 10D425
  144. FLASH32_ID      = 269538341         ; Flash32 1010D425
  145. FL32_ID_2BYTE   = 269538341         ; Flash32 1010D425
  146. FL32_ID_1BYTE   = 269538341         ; Flash32 1010D425
  147. NETCARD1_ID     = 49749             ; Un00C255
  148. OEMCARD1_ID     = 134267477         ; Un0800C255
  149. NETCARD2_ID     = 13216416          ; SnC9AAA0
  150. OEMCARD2_ID     = 1305062048        ; Sn4DC9AAA0
  151. NETCARD3_ID     = 13216432          ; SnC9AAB0
  152. OEMCARD3_ID     = 1305062064        ; Sn4DC9AAB0
  153. NETCARD4_ID     = 13216464          ; SnC9AAD0
  154. OEMCARD4_ID     = 1305062096        ; Sn4DC9AAD0
  155. NETCARD5_ID     = 2136129           ; In209841
  156. OEMCARD5_ID     = 18913345          ; In01209841
  157.  
  158. ;
  159. ; Registry Key
  160. ;
  161. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  162. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  163.  
  164. [ProductType]
  165. STF_PRODUCT  = Winnt
  166. STF_PLATFORM = I386
  167.  
  168. [GeneralConstants]
  169. ;
  170. ;  Program flow control variables.
  171. ;
  172. from      = ""
  173. to        = ""
  174.  
  175. ;
  176. ;  Return codes; Exit_Code is set to one of these
  177. ;
  178. ExitCodeOk     = 0
  179. ExitCodeCancel = 1
  180. ExitCodeFatal  = 2
  181.  
  182. KeyNull            = ""
  183. MAXIMUM_ALLOWED    = 33554432
  184. RegistryErrorIndex = NO_ERROR
  185. KeyProduct         = ""
  186. KeyParameters      = ""
  187.  
  188. TRUE            = 1
  189. FALSE           = 0
  190. NoTitle         = 0
  191.  
  192. ExitState   = "Active"
  193. OldVersionExisted = $(FALSE)
  194.  
  195. DriverPath      = $(!STF_NTPATH)\drivers
  196.  
  197. EisaId      = $(FLASH32_ID)
  198.  
  199. ;***********************************************************************
  200. ; Language-Dependent Dialog Constants
  201. ;***********************************************************************
  202.  
  203. [FileConstantsENG]
  204. ;
  205. ;  Variables to support thermometer gauge and error dialogs
  206. ;
  207. ProCaption   = "Windows NT Setup"
  208. ProCancel    = "Cancel"
  209. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  210.            "Are you sure you want to cancel copying files?"
  211.  
  212. ProCancelCap = "Network Setup Message"
  213. ProText1     = "Copying:"
  214. ProText2     = "To:"
  215.  
  216. ;
  217. ; Product Info
  218. ;
  219. FunctionTitle = "Intel Flash32 LAN Adapter Setup"
  220.  
  221. ;
  222. ; Software
  223. ;
  224. ProductSoftwareDescription = "Intel Flash32 LAN Adapter Miniport Driver"
  225.  
  226. ;
  227. ; Hardware
  228. ;
  229. ProductHardwareDescription = "Intel Flash32 LAN Adapter"
  230.  
  231. ;
  232. ; Dialog Message Information
  233. ;
  234. CANNOT_FIND_ANY_CARD       = "Network card is not present in the system"
  235.  
  236. [DialogConstantsENG]
  237. ;
  238. ; Common button names, etc.
  239. ;
  240. Help        = "&Help"
  241. Exit        = "Cancel"
  242. OK          = "OK"
  243. HelpContext = ""
  244. Continue    = "Continue"
  245. Cancel      = "Cancel"
  246.  
  247. [date]
  248.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  249.     ; Minute, Second }
  250.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  251.  
  252. [Source Media Descriptions]
  253.     1  = "Intel Flash32 Driver Disk"
  254.  
  255. [Signature]
  256.     FileType = MICROSOFT_DRVLIB_FILE
  257. [GetSignature]
  258.     read-syms Signature
  259.     return $(FileType)
  260.  
  261. ;-----------------------------------------------
  262. ; Input DIALOGS
  263. ;-----------------------------------------------
  264. [FileDependentDlgENG]
  265.  
  266. ;---------------------------------------------------------------------------
  267. ; 1. Identify
  268. ;
  269. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  270. ;                as we are choosing currently.
  271. ;
  272. ; INPUT:         None
  273. ;
  274. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  275. ;                $($R1): Option Type (COMPUTER ...)
  276. ;                $($R2): Diskette description
  277. ;---------------------------------------------------------------------------
  278.  
  279. [Identify]
  280.     read-syms Identification
  281.  
  282.     ; set !G:DebugOutputControl = 1
  283.  
  284.     set Status     = STATUS_SUCCESSFUL
  285.     set Identifier = $(OptionType)
  286.     set Media      = #("Source Media Descriptions", 1, 1)
  287.  
  288.     Return $(Status) $(Identifier) $(Media)
  289.  
  290. ;------------------------------------------------------------------------
  291. ; 2. ReturnOptions:
  292. ;
  293. ; DESCRIPTION:   To return the option list supported by this INF and the
  294. ;                localised text list representing the options.
  295. ;
  296. ;
  297. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  298. ;
  299. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  300. ;                                STATUS_NOLANGUAGE
  301. ;                                STATUS_FAILED
  302. ;                                STATUS_NOTSUPPORTED
  303. ;
  304. ;                $($R1): Option List
  305. ;                $($R2): Option Text List
  306. ;------------------------------------------------------------------------
  307.  
  308. [ReturnOptions]
  309.     set Status         = STATUS_FAILED
  310.     set OptionList     = {}
  311.     set OptionTextList = {}
  312.  
  313.     ;
  314.     ; Check if the language requested is supported
  315.     ;
  316.     set LanguageList = ^(LanguagesSupported, 1)
  317.     Ifcontains(i) $($0) in $(LanguageList)
  318.     ;
  319.     ; Check if the platforms requested is supported
  320.     ;
  321.     ifstr(i) $($1) == ""
  322.         goto returnoptions
  323.     endif
  324.  
  325.     set PlatformList = ^(PlatformsSupported, 1)
  326.     Ifcontains(i) $($1) in $(PlatformList)
  327.         goto returnoptions
  328.     else
  329.         set Status = STATUS_NOTSUPPORTED
  330.         goto finish_ReturnOptions
  331.     endif
  332.     else
  333.     set Status = STATUS_NOLANGUAGE
  334.     goto finish_ReturnOptions
  335.     endif
  336.  
  337.     ;
  338.     ; form a list of all the options and another of the text representing
  339.     ;
  340. returnoptions = +
  341.     set OptionList     = ^(Options, 1)
  342.     set OptionTextList = ^(OptionsText$($0), 1)
  343.     set Status         = STATUS_SUCCESSFUL
  344.  
  345. finish_ReturnOptions = +
  346.     Return $(Status) $(OptionList) $(OptionTextList)
  347.  
  348. ;------------------------------------------------------------------------
  349. ; InstallOption:
  350. ;
  351. ;      This section is shelled to by main installation processing
  352. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  353. ;
  354. ; FUNCTION:  To copy files representing Options
  355. ;            To configure the installed option
  356. ;            To update the registry for the installed option
  357. ;
  358. ; INPUT:     $($0):  Language to use
  359. ;            $($1):  OptionID to install
  360. ;            $($2):  SourceDirectory
  361. ;            $($3):  AddCopy  (YES | NO)
  362. ;            $($4):  DoCopy   (YES | NO)
  363. ;            $($5):  DoConfig (YES | NO)
  364. ;
  365. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  366. ;                            STATUS_NOLANGUAGE |
  367. ;                            STATUS_USERCANCEL |
  368. ;                            STATUS_FAILED
  369. ;------------------------------------------------------------------------
  370. [InstallOption]
  371.  
  372.     ; set !G:DebugOutputControl = 1
  373.  
  374.     ;
  375.     ; Set default values
  376.     ;
  377.     Debug-Output "At InstallOption"
  378.     set Status   = STATUS_FAILED
  379.  
  380.     ;
  381.     ; extract parameters
  382.     ;
  383.     set Option   = $($1)
  384.     set SrcDir   = $($2)
  385.     set AddCopy  = $($3)
  386.     set DoCopy   = $($4)
  387.     set DoConfig = $($5)
  388.  
  389.     ;
  390.     ; Check if the language requested is supported
  391.     ;
  392.     set LanguageList = ^(LanguagesSupported, 1)
  393.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  394.     Return STATUS_NOLANGUAGE
  395.     endif
  396.  
  397.     set-subst LF = "\n"
  398.  
  399.     read-syms GeneralConstants
  400.     read-syms FileConstants
  401.  
  402.     read-syms DialogConstants$(!STF_LANGUAGE)
  403.     ifstr(i) $(!NTN_Origination) == "NCPA"
  404.     set Continue = "OK"
  405.     endif
  406.  
  407.     read-syms FileConstants$(!STF_LANGUAGE)
  408.  
  409.     detect date
  410.  
  411.     set-title  $(FunctionTitle)
  412.  
  413. ;NT 4.0 start
  414.     set CurrentVersionValue = ""
  415.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows NT\CurrentVersion" $(!REG_KEY_READ) KeyWinNT
  416.     ifstr(i) $(KeyWinNT) != ""
  417.     GetRegValue $(KeyWinNT) "CurrentVersion" CurrentVersionValue
  418.     CloseRegKey $(KeyWinNT)
  419.     endif
  420.  
  421.     set m_WinNTVersion = *($(CurrentVersionValue),4)
  422. ;NT 4.0 end
  423.  
  424.     set to   = Begin
  425.     set from = Begin
  426.  
  427.     ;
  428.     ; Assume all is well.
  429.     ;
  430.     set CommonStatus = STATUS_SUCCESSFUL
  431.  
  432.     EndWait
  433.  
  434. ;
  435. ; Set up the operation-mode-based variables and welcome
  436. ; the user.  If the "install mode" variable is improperly set,
  437. ; assume this is a new installation.
  438. ;
  439. Begin = +
  440.     Debug-Output "At Begin"
  441.  
  442.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  443.     set StartLabel = removeadapter
  444.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  445.     set StartLabel = UpgradeSoftware
  446.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  447.     set StartLabel = bindingadapter
  448.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  449.     ;
  450.     ; You cannot config the software component
  451.     ;
  452.     Debug-Output "Configure: ProductKeyName, NTN_RegBase="$(ProductKeyName)","$(!NTN_RegBase)
  453.  
  454.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  455.         Debug-Output "Cannot configure the Flash32 driver software."
  456.         goto setfailed
  457.     else
  458. ;-----------------------------------------------
  459. ; Configuration Section
  460. ;-----------------------------------------------
  461.         Debug-Output "Configuring the Flash32 driver software."
  462.  
  463. ; kroot !!!
  464. ;
  465. ;   This happens when the user is trying to configure the adapter.
  466. ;   We're going to allow the user to reconfigure the configurable
  467. ;   parameters: FIFO, ON, OFF.
  468. ;
  469. ;   Since we've already installed the driver we have initial values for
  470. ;   these already in the registry (see the adapterverify section).
  471. ;   What would be cool is if we could get the values that exist already
  472. ;   for these parameters and put them into the dialog box for the user,
  473. ;   otherwise things are confusing for folks.
  474. ;
  475.         ;********************************************************
  476.         ; 1) Get the current values.
  477.         ;    OK, OK. But first we gotta get some handles and whatnot.
  478.         ;
  479.         Ifstr $(KeyProduct) == $(KeyNull)
  480.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  481.         Ifstr $(KeyProduct) == $(KeyNull)
  482.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  483.             Debug-Output "Cannot find component product key"
  484.             goto fatalregistry
  485.         Endif
  486.         Endif
  487.  
  488.         ;
  489.         ; Get the other parameters;  they're attached to the service parameters key
  490.         ;
  491.         Debug-Output "INF: Shelling to FindService"
  492.  
  493.         Shell $(UtilityInf) FindService, $(KeyProduct)
  494.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  495.         Debug-Output "INF: FindService shell failure"
  496.         Goto ShellCodeError
  497.         Endif
  498.  
  499.         Ifstr(i) $($R0) != NO_ERROR
  500.         Debug-Output "INF: FindService Shell error: "$($R0)
  501.         Goto fatalregistry
  502.         Endif
  503.  
  504.         Set KeyParameters = $($R2)
  505.  
  506.         ;
  507.         ;  We don't need the services key, so close it.
  508.         ;
  509.         CloseRegKey $($R1)
  510.  
  511.         Ifstr $(KeyParameters) == $(KeyNull)
  512.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  513.         Debug-Output "Cannot find component service"
  514.         goto fatalregistry
  515.         Endif
  516.  
  517.         set ValueName = ""
  518.         set ValueData = ""
  519.         set ValueStr  = ""
  520.         set ValueList = {}
  521.  
  522.         ;
  523.         ; Get the old values, finally.
  524.         ;
  525.         EnumRegValue $(KeyParameters) ValueList
  526.  
  527.         ForListDo $(ValueList)
  528.         set ValueItem = $($)
  529.         set ValueName = *($(ValueItem),1)
  530.         set ValueData = *($(ValueItem),4)
  531.  
  532.         Ifstr(i) $(ValueName) == "Fifo"
  533.             set FifoValue = $(ValueData)
  534.             Debug-Output "Registry FIFO: "$(FifoValue)
  535.         else-ifstr(i) $(ValueName) == "On"
  536.             set OnValue = $(ValueData)
  537.             Debug-Output "Registry ON: "$(OnValue)
  538.         else-ifstr(i) $(ValueName) == "Off"
  539.             set OffValue = $(ValueData)
  540.             Debug-Output "Registry OFF: "$(OffValue)
  541.         else-ifstr(i) $(ValueName) == "Slot"
  542.             set SlotValue = $(ValueData)
  543.             Debug-Output "Registry SLOT: "$(SlotValue)
  544.         endif
  545.         EndForListDo
  546.  
  547.         ;
  548.         ; Might have to set defaults - just in case.
  549.         ;
  550.         ifstr(i) $(FifoValue) == ""
  551.         set FifoValue = 12
  552.         Debug-Output "Setting Default FIFO"
  553.         endif
  554.  
  555.         ifstr(i) $(OnValue) == ""
  556.         set OnValue = 256
  557.         Debug-Output "Setting Default ON"
  558.         endif
  559.  
  560.         ifstr(i) $(OffValue) == ""
  561.         set OffValue = 10
  562.         Debug-Output "Setting Default OFF"
  563.         endif
  564.  
  565.         ifstr(i) $(SlotValue) == ""
  566.         set SlotValue = 0
  567.         Debug-Output "Setting Default SLOT"
  568.         endif
  569.  
  570.         ;********************************************************
  571.         ; 2) At this point, we have the current registry values
  572.         ;    for the variable parameters.
  573.         ;    Now we need to open up the DLL and tell it what the
  574.         ;    the values are.
  575.  
  576.         ;
  577.         ; Load the FL32NT.DLL and set the current values.
  578.         ;
  579.         LoadLibrary "x" $(!STF_NTPATH)\FL32NT.DLL MYLIBHANDLE
  580. ;           LibraryProcedure MyResult $(MYLIBHANDLE), InitSlotArray  ;, $(!STF_HWND), $(!NCPA_HANDLE)
  581.         LibraryProcedure MyResult $(MYLIBHANDLE), InitSlotArray
  582.  
  583.         Shell $(UtilityInf), EISAFindBus, $(NETCARD_ID)
  584.         ifstr(i) $($R1) != {}
  585.         Debug-Output "EISA Controller NETCARD_ID found!"
  586.         set AdapterList = $($R1)
  587.  
  588.         ; this is to add this slot number to the slotlist in the dll.
  589.         LibraryProcedure MyResult $(MYLIBHANDLE), IncSlotValue, $(!STF_HWND), $(!NCPA_HANDLE), $(SlotValue)
  590.  
  591.         set EisaId = $(FLASH32_ID)
  592.         Debug-Output "EISA Controller NETCARD_ID:::  $($R1) "
  593.         goto ContinueConf
  594.         endif
  595.  
  596.         Debug-Output "EISA Controller Search failed! - this means none were found anywhere!!!"
  597.         Debug-Output "EISA Controller NETCARD4_ID:::  $($R1) "
  598.         set NoCard = "TRUE"
  599. ;           goto ContinueConf
  600.  
  601. ContinueConf = +
  602.         LibraryProcedure MyResult $(MYLIBHANDLE), SetSlotValue, $(!STF_HWND), $(!NCPA_HANDLE), $(SlotValue)
  603.         LibraryProcedure MyResult $(MYLIBHANDLE), SetFifoValue, $(!STF_HWND), $(!NCPA_HANDLE), $(FifoValue)
  604.         LibraryProcedure MyResult $(MYLIBHANDLE), SetOnValue, $(!STF_HWND), $(!NCPA_HANDLE), $(OnValue)
  605.         LibraryProcedure MyResult $(MYLIBHANDLE), SetOffValue, $(!STF_HWND), $(!NCPA_HANDLE), $(OffValue)
  606.  
  607.         ;
  608.         ; Now put up the dialog box and it should have the last user
  609.         ; entered values.
  610.         ;
  611.         LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, $(!STF_HWND), $(!NCPA_HANDLE)
  612.  
  613.         ifstr(i) $(MyResult) == "CANCEL"
  614.         set OEM_ABANDON_OPTIONS = {}
  615.         goto abandon
  616.         endif
  617.  
  618.         ifstr(i) $(MyResult) == "OK"
  619.         ;
  620.         ; If the user says it's OK, go get the new parameter values...
  621.         ;
  622.         LibraryProcedure SlotValue $(MYLIBHANDLE), GetSlotValue, $(!STF_HWND), $(!NCPA_HANDLE)
  623.         LibraryProcedure FifoValue $(MYLIBHANDLE), GetFifoValue, $(!STF_HWND), $(!NCPA_HANDLE)
  624.         LibraryProcedure OnValue $(MYLIBHANDLE), GetOnValue, $(!STF_HWND), $(!NCPA_HANDLE)
  625.         LibraryProcedure OffValue $(MYLIBHANDLE), GetOffValue, $(!STF_HWND), $(!NCPA_HANDLE)
  626.  
  627. writeparameters1 = +
  628.  
  629.         ;
  630.         ; ...and write them to the registry.
  631.         ;
  632.         Debug-Output "At writeparameters"
  633.  
  634.         Shell $(UtilityInf), GetBusTypeNum
  635.  
  636.         set BusTypeNum = $($R1)
  637.  
  638.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  639.             Debug-Output "ShellCode error."
  640.             goto ShellCodeError
  641.         endif
  642.  
  643.         ;
  644.         ; Add the rest of the parameters to the Services area
  645.         ;
  646.         set NewValueList = {{Fifo,$(NoTitle),$(!REG_VT_DWORD),$(FifoValue)},+
  647.                     {On,$(NoTitle),$(!REG_VT_DWORD),$(OnValue)},+
  648.                     {Slot,$(NoTitle),$(!REG_VT_DWORD),$(SlotValue)},+
  649.                     {Off,$(NoTitle),$(!REG_VT_DWORD),$(OffValue)}}
  650.  
  651.         Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  652.  
  653.         CloseRegKey $(KeyParameters)
  654.  
  655.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  656.             Debug-Output "ShellCode error."
  657.             goto ShellCodeError
  658.         endif
  659.  
  660.         set RegistryErrorIndex = $($R0)
  661.  
  662.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  663.             Debug-Output "Registry error: Add value list"
  664.             goto fatalregistry
  665.         endif
  666.  
  667.         endif   ; OK
  668.  
  669.         FreeLibrary $(MYLIBHANDLE)
  670.  
  671.         goto successful
  672.     endif
  673.  
  674.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  675.         Debug-Output "ShellCode error: cannot get an error string."
  676.         goto ShellCodeError
  677.     endif
  678.  
  679.     set Error = $($R0)
  680.     set from = end
  681.     set to = end
  682.     goto nonfatalinfo
  683.     else
  684.     set StartLabel = installadapter
  685.     set OEM_ABANDON_OPTIONS = {}
  686.     set OEM_ABANDON_SOFTWARE = FALSE
  687.     set OEM_ABANDON_ON = TRUE
  688.     endif
  689.  
  690.     Set from = $(fatal)
  691.     Set to = $(fatal)
  692.     Goto $(StartLabel)
  693.  
  694. ;-----------------------------------------------
  695. ; Installation Section
  696. ;-----------------------------------------------
  697.  
  698. installadapter = +
  699.     Debug-Output "At installadapter"
  700.  
  701.     ;
  702.     ; First, check whether the same version of the software exists
  703.     ;
  704.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  705.  
  706.     Ifstr $(KeyProduct) != $(KeyNull)
  707.     ;
  708.     ; Same version already existed in the local machine
  709.     ; Popup the dialog and ask the user whether he wants to continue
  710.     ;
  711.     CloseRegKey $(KeyProduct)
  712.  
  713.     ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  714.        ;
  715.        ; Cannot Install the same software again
  716.        ;
  717.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle), $(ProductVersion)
  718.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  719.            Debug-Output "ShellCode error: cannot get an error string."
  720.            goto ShellCodeError
  721.        endif
  722.        goto end
  723.     else
  724.        ;
  725.        ; Add a new adapter card?
  726.        ;
  727.        set OldVersionExisted = $(TRUE)
  728.     endif
  729.     endif
  730.  
  731. adapterverify = +
  732.  
  733.     Debug-Output "At adapterverify"
  734.  
  735.     set NoCard = "FALSE"
  736.     set AdapterList = $($R1)
  737.  
  738.     ;
  739.     ; Add Software Component
  740.     ;
  741.     ifstr(i) $(!NTN_InstallMode) == "install"
  742.  
  743. ;    ; see if the driver is already present
  744. ;    Shell $(UtilityInf) CheckIfCopyNecessary $(!STF_WINDOWSSYSPATH)\drivers fl32mini.sys
  745. ;    Debug-Output "Check Copy **** "$($R0)
  746. ;
  747. ;    ; if it is, ask the user if she wants to use the current driver
  748. ;    ; or replace the current one with a new one
  749. ;    ; -- hey, now this looks just like WFW that other Microsoft product.
  750. ;    ;    What a concept!
  751. ;    ifstr(i) $($R0) == STATUS_SUCCESSFUL
  752. ;        Shell "subroutn.inf" DriversExist $(!STF_LANGUAGE) "LAN adapter"
  753. ;        Debug-Output "DriversExist Status = "$($R0)
  754. ;        ifstr(i) $($R0) == "STATUS_CURRENT"
  755. ;        Debug-Output "CURRENT"
  756. ;        goto JustAddIt
  757. ;        else-ifstr(i) $($R0) == "STATUS_USERCANCEL"
  758. ;        Debug-Output "CANCEL"
  759. ;        goto successful
  760. ;        endif
  761. ;    endif
  762.  
  763.     ; we'll get here if the user wants to install a new driver
  764.     Ifstr(i) $(DoCopy) == "YES"
  765.         Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  766.  
  767.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  768.         Goto ShellCodeError
  769.         Else-Ifstr(i) $($R0) == STATUS_FAILED
  770.         Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  771.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  772.             goto ShellCodeError
  773.         endif
  774.         set Error = $($R0)
  775.         Goto fatal
  776.         Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  777.         Goto successful
  778.         Endif
  779.  
  780.         Set SrcDir = $($R1)
  781.  
  782.     Endif
  783.  
  784.     Debug-Output "At install Install-Option"
  785.  
  786.     install "Install-Option"
  787.     ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  788.         Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  789.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  790.         goto ShellCodeError
  791.         endif
  792.         set Error = $($R0)
  793.         goto fatal
  794.     endif
  795.     endif
  796.  
  797. JustAddIt = +
  798.  
  799.     StartWait
  800.  
  801.     set DriverOnly = "FALSE"
  802.  
  803.     LoadLibrary "x" $(!STF_NTPATH)\FL32NT.DLL MYLIBHANDLE
  804.     Debug-Output "made it past load library, right before initslotaray"
  805. ;   LibraryProcedure MyResult $(MYLIBHANDLE), InitSlotArray  ;, $(!STF_HWND), $(!NCPA_HANDLE)
  806.     LibraryProcedure MyResult $(MYLIBHANDLE), InitSlotArray
  807.     Debug-Output "made it past initslotaray"
  808.  
  809.     Debug-Output $(NETCARD_ID)
  810.     Shell $(UtilityInf), EISAFindBus, $(NETCARD_ID)
  811.     ifstr(i) $($R1) != {}
  812.     Debug-Output "EISA Controller NETCARD_ID found!"
  813.     set AdapterList = $($R1)
  814.  
  815.     ; this is to add this slot number to the slotlist in the dll.
  816.     ForListDo $(AdapterList)
  817.         set TestBusNum = *($($),1)
  818.         set TestSlot = *($($),2)
  819.         Debug-Output "IsFL32 Slot = "$(TestSlot)
  820.         Shell "" IsFL32CardAlreadyInstalled, $(TestBusNum), $(TestSlot), +
  821.              $(ProductHardwareDescription), $(ProductHardwareName)
  822.         set RetVal0 = $($R0)
  823.         set RetVal1 = $($R1)
  824.  
  825.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  826.         goto ShellCodeError
  827.         endif
  828.  
  829.         ifstr $(RetVal0) != "NO_ERROR"
  830.         set Error = $($R0)
  831.         goto fatal
  832.         endif
  833.  
  834.         ifstr $(RetVal1) != "YES"
  835.         Debug-Output "Incrementing slot value............."
  836.         LibraryProcedure MyResult $(MYLIBHANDLE), IncSlotValue, $(!STF_HWND), $(!NCPA_HANDLE), *($($),2)
  837.         else
  838.         LibraryProcedure MyResult $(MYLIBHANDLE), SetSlotUsed, $(!STF_HWND), $(!NCPA_HANDLE), *($($),2)
  839.         endif
  840.     EndForListDo
  841.  
  842.     set EisaId = $(FLASH32_ID)
  843.     Debug-Output "EISA Controller NETCARD_ID:::  $($R1) "
  844.     goto ContinueInst
  845.     endif
  846.  
  847.     Debug-Output "EISA Controller Search failed! - this means none were found anywhere!!!"
  848.     Debug-Output "EISA Controller NETCARD4_ID:::  $($R1) "
  849.     set NoCard = "TRUE"
  850.  
  851.  
  852. ContinueInst = +
  853.  
  854.     ifint $(OldVersionExisted) == $(FALSE)
  855.  
  856.     Debug-Output "At AddSoftwareComponent $(OldVersionExisted) ::::: $(FALSE)"
  857.  
  858.     Debug-Output "111111 STF_CONTEXTINFNAME = "$(STF_CONTEXTINFNAME)
  859.  
  860.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  861.         $(ProductSoftwareName), +
  862.         $(ProductSoftwareName), +
  863.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  864.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  865.         $(NetEventDLL)
  866.  
  867.     Set OEM_ABANDON_SOFTWARE = TRUE
  868.  
  869.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  870.         Debug-Output "ShellCode error"
  871.         goto ShellCodeError
  872.     endif
  873.  
  874.     ;
  875.     ;   At this point:
  876.     ;     $R1 contains the product version key handle;
  877.     ;     $R2 contains the NetRules subkey handle;
  878.     ;     $R3 contains the new Services key handle; and
  879.     ;     $R4 contains the Parameters key
  880.     ;     $R5 contains the Linkage Key
  881.     ;
  882.     set RegistryErrorIndex = $($R0)
  883.     set KeyProduct      = $($R1)
  884.     Set SoftNetRulesKey = $($R2)
  885.     CloseRegKey $($R3)
  886.     CloseRegKey $($R4)
  887.     CloseRegKey $($R5)
  888.  
  889.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  890.         EndWait
  891.         Debug-Output "Registry error: add software components"
  892.         CloseRegKey $(KeyProduct)
  893.         CloseRegKey $(SoftNetRulesKey)
  894.         goto fatalregistry
  895.     endif
  896.  
  897.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  898.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  899.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  900.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  901.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  902.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  903.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  904.  
  905.     Debug-Output "At AddValueList - SoftwareType"
  906.     Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  907.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  908.         Debug-Output "ShellCode error."
  909.         goto ShellCodeError
  910.     endif
  911.  
  912.     set RegistryErrorIndex = $($R0)
  913.  
  914.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  915.         EndWait
  916.         Debug-Output "Registry error: add value list."
  917.         CloseRegKey $(KeyProduct)
  918.         CloseRegKey $(SoftNetRulesKey)
  919.         goto fatalregistry
  920.     endif
  921.  
  922.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  923.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  924.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  925.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  926.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  927.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  928.  
  929.     Debug-Output "At AddValueList - bindform"
  930.     Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  931.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  932.         Debug-Output "ShellCode error."
  933.         goto ShellCodeError
  934.     endif
  935.  
  936.     set RegistryErrorIndex = $($R0)
  937.  
  938.     CloseRegKey $(KeyProduct)
  939.     CloseRegKey $(SoftNetRulesKey)
  940.  
  941.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  942.         EndWait
  943.         Debug-Output "Resgitry error: add value list."
  944.         goto fatalregistry
  945.     endif
  946.     endif
  947.  
  948.     ;
  949.     ; Create the HARDWARE\Netcard region and its corresponding service
  950.     ;
  951. CreateDriverEntry = +
  952.  
  953.     Debug-Output "At CreateDriverEntry"
  954.  
  955.     set CardInstalled = "NO"
  956.  
  957.     ;set BusNum = *($($),1)
  958.     ;set SlotNum = *($($),2)
  959.     set BusNum = 0
  960.     set SlotNum = 1
  961.  
  962.     Debug-Output "Adding registry parameters, BusNum $(BusNum) SlotNum $(SlotNum)"
  963.  
  964.     ifstr $(SlotNum) != "0"
  965.  
  966.     ifstr $(DriverOnly) == "TRUE"
  967.         set Retval0 = "NO_ERROR"
  968.         set Retval1 = "NO"
  969.     else
  970.         Shell "", IsFL32CardAlreadyInstalled, $(BusNum), +
  971.         $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  972.         set Retval0 = $($R0)
  973.         set Retval1 = $($R1)
  974.     endif
  975.  
  976.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  977.         goto ShellCodeError
  978.     endif
  979.  
  980.     ifstr $(Retval0) != "NO_ERROR"
  981.         set Error = $($R0)
  982.         goto fatal
  983.     endif
  984.  
  985.     ifstr(i) $(Retval1) != "YES"
  986.         Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  987.  
  988.         ifint $($R4) != -1
  989.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), +
  990.                         $(!NTN_SoftwareBase)+
  991.                         "\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  992.         endif
  993.  
  994.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  995.         goto ShellCodeError
  996.         endif
  997.  
  998.         set RegistryErrorIndex = $($R0)
  999.  
  1000.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  1001.         EndWait
  1002.         CloseRegKey $($R1)
  1003.         CloseRegKey $($R2)
  1004.         CloseRegKey $($R3)
  1005.         goto fatalregistry
  1006.         endif
  1007.  
  1008.         ;
  1009.         ;   At this point:
  1010.         ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  1011.         ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  1012.         ;     $R3  Registry key handle for <service>\Parameters key
  1013.         ;     $R4  Adapter number assigned to adapter
  1014.         ;     $R5  Service name generated by combining svc name with adapter number
  1015.         ;
  1016.         Set HardNetCardKey      = $($R1)
  1017.         Set HardNetRuleKey      = $($R2)
  1018.         Set HardParameterKey    = $($R3)
  1019.         set AdapterNumber       = $($R4)
  1020.  
  1021.         set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1022.                    {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  1023.                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  1024.                    {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1025.                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1026.                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1027.  
  1028.         Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  1029.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1030.         goto ShellCodeError
  1031.         endif
  1032.  
  1033.         ;
  1034.         ; Put up the dialog box and allow the user to configure
  1035.         ; FIFO, ON, OFF parameters.  We have found the board in a
  1036.         ; particular slot so we won't allow them to alter the slot
  1037.         ; parameter yet.
  1038.         ;
  1039.         ifstr $(DriverOnly) == "TRUE"
  1040.         LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, $(!STF_HWND), $(!NCPA_HANDLE)
  1041.         else
  1042.         LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, $(!STF_HWND), $(!NCPA_HANDLE)
  1043.         endif
  1044.  
  1045.         ;*--- this is if the user cancelled from the dialog box ---*
  1046.         Debug-Output "MyResult = "$(MyResult)
  1047.         ifstr(i) $(MyResult) == "CANCEL"
  1048.         goto abandon
  1049.         endif
  1050.  
  1051.         ifstr(i) $(MyResult) == "OK"
  1052.         LibraryProcedure SlotNum $(MYLIBHANDLE), GetSlotValue, $(!STF_HWND), $(!NCPA_HANDLE)
  1053.         LibraryProcedure FifoValue $(MYLIBHANDLE), GetFifoValue, $(!STF_HWND), $(!NCPA_HANDLE)
  1054.         LibraryProcedure OnValue $(MYLIBHANDLE), GetOnValue, $(!STF_HWND), $(!NCPA_HANDLE)
  1055.         LibraryProcedure OffValue $(MYLIBHANDLE), GetOffValue, $(!STF_HWND), $(!NCPA_HANDLE)
  1056.         endif
  1057.  
  1058.         FreeLibrary $(MYLIBHANDLE)
  1059.  
  1060.         set CardInstalled = "YES"
  1061.  
  1062.         set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  1063.                 {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  1064.                 {Eid,$(NoTitle),$(!REG_VT_DWORD),$(EisaId)},+
  1065.                 {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  1066.                 {Fifo,$(NoTitle),$(!REG_VT_DWORD),$(FifoValue)},+
  1067.                 {Driv,$(NoTitle),$(!REG_VT_DWORD),2},+
  1068.                 {Slot,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)},+
  1069.                 {On,$(NoTitle),$(!REG_VT_DWORD),$(OnValue)},+
  1070.                 {Off,$(NoTitle),$(!REG_VT_DWORD),$(OffValue)}+
  1071.                    }
  1072.  
  1073.         Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  1074.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1075.         goto ShellCodeError
  1076.         endif
  1077.  
  1078.         set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1079.         set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1080.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1081.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1082.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1083.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)} }
  1084.         Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  1085.  
  1086.         CloseRegKey $(HardNetCardKey)
  1087.         CloseRegKey $(HardNetRuleKey)
  1088.         CloseRegKey $(HardParameterKey)
  1089.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1090.         goto ShellCodeError
  1091.         endif
  1092.     endif
  1093.     endif
  1094.  
  1095.     ifstr $(DriverOnly) == "TRUE"
  1096.     goto writeparameters2
  1097.     endif
  1098.  
  1099.     ;
  1100.     ; If no cards were installed, it means that either there were no cards
  1101.     ; found (NoCard = TRUE) or all cards in the system have already had
  1102.     ; drivers installed for them (CardInstalled = NO).
  1103.     ;
  1104.     ; What we want to do here is allow the user to install the driver for
  1105.     ; a board that is not yet in the system.  This way the user can get the
  1106.     ; driver installed, shutdown NT, install the adapter and reboot.
  1107.     ; If we don't let the user install a driver for a non-existent board,
  1108.     ; then he has to shutdown NT, install the board, reboot, install the
  1109.     ; driver, shutdown and then reboot again - what a pain.
  1110.     ;
  1111. AddDriverWithoutBoard =  +
  1112.  
  1113.     Debug-Output "At AddDriverWithoutBoard"
  1114.  
  1115.     ifstr $(NoCard) == "TRUE"
  1116.     Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" "No adapter found.  Install driver anyway?"
  1117.     ifstr(i) $($R1) == "OK"
  1118.         ;
  1119.         ; NOTE: this will only work for Flash32 boards
  1120.         ;
  1121.         set EisaId = "269538341"
  1122.         set AdapterList = {{"0", "10", "269538341"}}
  1123.         set DriverOnly = "TRUE"
  1124.         set NoCard = "FALSE"
  1125.         goto CreateDriverEntry
  1126.     endif
  1127.     endif
  1128.  
  1129.     ifstr $(CardInstalled) == "NO"
  1130.     Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) +
  1131.         "WARNING" "Drivers are already installed for the current hardware.  Install driver anyway?"
  1132.     ifstr(i) $($R1) == "OK"
  1133.         ;
  1134.         ; NOTE: this will only work for Flash32 boards
  1135.         ;
  1136.         set EisaId = "269538341"
  1137.         set AdapterList = {{"0", "10", "269538341"}}
  1138.         set DriverOnly = "TRUE"
  1139.         goto CreateDriverEntry
  1140.     endif
  1141.     endif
  1142.  
  1143. ;
  1144. ; REQUIRED:   $(KeyParameters) contains service Parameters key handle
  1145. ;
  1146. writeparameters2 = +
  1147.     Debug-Output "At writeparameters"
  1148.     EndWait
  1149.     goto successful
  1150.  
  1151. ;-----------------------------------------------
  1152. ; Binding section
  1153. ;-----------------------------------------------
  1154. bindingadapter =+
  1155.     Debug-Output "At bindingadapter"
  1156.     set Error = "Binding: Sorry, not yet implemented."
  1157.     goto fatal
  1158.  
  1159. ;-----------------------------------------------
  1160. ; Removeadapter section
  1161. ;-----------------------------------------------
  1162.  
  1163. removeadapter = +
  1164.     Debug-Output "At removeadapter"
  1165.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1166.     ;
  1167.     ; Remove Software Component
  1168.     ;
  1169.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1170.         $(ProductSoftwareName)
  1171.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1172.         Debug-Output "ShellCode error"
  1173.         goto ShellCodeError
  1174.     endif
  1175.  
  1176.     set RegistryErrorIndex = $($R0)
  1177.  
  1178.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1179.         goto fatalregistry
  1180.     endif
  1181.     else
  1182.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1183.         $(ProductSoftwareName), $(!NTN_RegBase)
  1184.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1185.         Debug-Output "ShellCode error"
  1186.         goto ShellCodeError
  1187.     endif
  1188.  
  1189.     set RegistryErrorIndex = $($R0)
  1190.  
  1191.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1192.         goto fatalregistry
  1193.     endif
  1194.     endif
  1195.  
  1196.     goto end
  1197.  
  1198. ;-----------------------------------------------
  1199. ; Upgrade Software section
  1200. ;-----------------------------------------------
  1201.  
  1202. UpgradeSoftware = +
  1203.     Debug-Output "At UpgradeSoftware"
  1204.     ;
  1205.     ; First determine whether we want to do upgrade or update for software
  1206.     ; or hardware component. Then we will determine whether the Mode is
  1207.     ; update or upgrade.
  1208.     ;
  1209.     ; If the same version of the product existed in the registry, we do
  1210.     ; update. Otherwise, we will do an upgrade.
  1211.     ;
  1212.     Debug-Output "ProductKeyName = "$(ProductKeyName)
  1213.     Debug-Output "!NTN_RegBase   = "$(!NTN_RegBase)
  1214.  
  1215.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1216.  
  1217.     Debug-Output "Upgrade Software Component"
  1218.  
  1219.     ;
  1220.     ; Upgrade software component
  1221.     ;
  1222.     ; see whether the same version exist or not
  1223.     ;
  1224.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1225.     Debug-Output "KeyProduct = "$(KeyProduct)
  1226.  
  1227.     Ifstr $(KeyProduct) != $(KeyNull)
  1228.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1229.         set Version = *($(VersionInfo), 4)
  1230.  
  1231.         ;
  1232.         ; Update the binaries
  1233.         ;
  1234.         Split-String $(!NTN_Infname), "\", FilenameList
  1235.         QueryListSize ListSize $(FilenameList)
  1236.         set !UG_Filename = *($(FilenameList), $(ListSize))
  1237.  
  1238.         install "Install-Update"
  1239.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1240.         goto fatal
  1241.         endif
  1242.  
  1243.         ; Upgrade the version number
  1244.         ;
  1245.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1246.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1247.  
  1248.         ;
  1249.         ; do nothing for update
  1250.         ;
  1251.         ifint $(Version) != $(ProductVersion)
  1252.            ;
  1253.            ; If the major version number is not the same,
  1254.            ; it is major upgrade. So let's Upgrade the product
  1255.            ;
  1256.            ; make other upgrade change if necessary
  1257.            ;
  1258.         endif
  1259.         CloseRegKey $(KeyProduct)
  1260.     else
  1261.         ;
  1262.         ; Cannot Open software key, goto ERROR
  1263.         ;
  1264.         goto fatalregistry
  1265.     endif
  1266.     else
  1267.     ;
  1268.     ; upgrade/update hardware component
  1269.     ; There is no different between upgrade and update for hardware
  1270.     ; component
  1271.     ;
  1272.     ; 1. Get the Service Name
  1273.     ; 2. Change the NetRule section if necessary
  1274.     ;
  1275.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1276.           $(MAXIMUM_ALLOWED) NetworkCardKey
  1277.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1278.         ;
  1279.         ; Get Service name
  1280.         ;
  1281.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1282.         set ServiceName = *($(ServiceNameInfo), 4)
  1283.  
  1284.         ;
  1285.         ; Change the NetRule if necessary
  1286.         ;
  1287.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1288.         $(MAXIMUM_ALLOWED) NetRuleKey
  1289.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1290.         ;
  1291.         ; Make the change....
  1292.         ;
  1293.         else
  1294.         ;
  1295.         ; Error, cannot open net rules key
  1296.         ;
  1297.         goto fatalregistry
  1298.         endif
  1299.  
  1300.         CloseRegKey $(NetRules)
  1301.         CloseRegKey $(NetworkCardKey)
  1302.     else
  1303.         ;
  1304.         ; Error, cannot open network card key
  1305.         ;
  1306.         goto fatalregistry
  1307.     endif
  1308.     ;
  1309.     ; 3. Change the service section of the hardware. i.e.,
  1310.     ;    ParameterName change, value change, etc.
  1311.     ;
  1312.     OpenRegKey $(!REG_H_LOCAL) "" +
  1313.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  1314.           $(MAXIMUM_ALLOWED) ServiceKey
  1315.  
  1316.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  1317.         ;
  1318.         ; Get the ServiceKey to change the Start value
  1319.         ; or Type value. Or open Parameters key to
  1320.         ; change the hardware parameters if necessary.
  1321.         ;
  1322.         CloseRegKey $(ServiceKey)
  1323.     else
  1324.         ;
  1325.         ; Error, cannot open network card key
  1326.         ;
  1327.         goto fatalregistry
  1328.     endif
  1329.     endif
  1330.  
  1331.     goto end
  1332.     ;
  1333.     ; End of Upgrade Software
  1334.     ;
  1335.  
  1336. ;
  1337. ;  Escape hatches
  1338. ;
  1339. successful = +
  1340.     Debug-Output "At successful"
  1341.     goto end
  1342.  
  1343. abandon = +
  1344.     Debug-Output "At abandon"
  1345.     ForListDo $(OEM_ABANDON_OPTIONS)
  1346.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1347.         $(ProductSoftwareName), $($)
  1348.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1349.         Debug-Output "ShellCode error"
  1350.         goto ShellCodeError
  1351.     endif
  1352.  
  1353.     set RegistryErrorIndex = $($R0)
  1354.  
  1355.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1356.         goto fatalregistry
  1357.     endif
  1358.     EndForListDo
  1359.  
  1360.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1361.     ; Remove Software Component
  1362.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1363.         $(ProductSoftwareName), FALSE
  1364.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1365.         Debug-Output "ShellCode error"
  1366.         goto ShellCodeError
  1367.     endif
  1368.  
  1369.     set RegistryErrorIndex = $($R0)
  1370.  
  1371.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1372.         goto fatalregistry
  1373.     endif
  1374.     endif
  1375.  
  1376.     goto end
  1377.  
  1378. ;
  1379. ; warning display
  1380. ;
  1381. warning = +
  1382.     Debug-Output "At warning"
  1383.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1384.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1385.     goto ShellCodeError
  1386.     endif
  1387.     ifstr(i) $($R1) == "OK"
  1388.     goto $(to)
  1389.     else-ifstr(i) $($R1) == "CANCEL"
  1390.     goto $(from)
  1391.     else
  1392.     goto "end"
  1393.     endif
  1394. ;
  1395. ; non fatal error display
  1396. ;
  1397. nonfatalinfo = +
  1398.     Debug-Output "At nonfatalinfo"
  1399.     Set Severity = STATUS
  1400.     Set CommonStatus = STATUS_USERCANCEL
  1401.     goto nonfatalmsg
  1402.  
  1403. nonfatal = +
  1404.     Debug-Output "At nonfatal"
  1405.     Set Severity = NONFATAL
  1406.     goto nonfatalmsg
  1407.  
  1408. nonfatalmsg = +
  1409.     Debug-Output "At nonfatalmsg"
  1410.     ifstr(i) $(Error) == ""
  1411.     Set Severity = NONFATAL
  1412.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1413.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1414.         goto ShellCodeError
  1415.     endif
  1416.     set Error = $($R0)
  1417.     endif
  1418.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1419.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1420.     goto ShellCodeError
  1421.     endif
  1422.     ifstr(i) $($R1) == "OK"
  1423.     goto $(from)
  1424.     else
  1425.     goto "end"
  1426.     endif
  1427.  
  1428. ;
  1429. ;  Registry is broken
  1430. ;
  1431. fatalregistry = +
  1432.     Debug-Output "At fatalregistry"
  1433.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1434.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1435.     goto ShellCodeError
  1436.     endif
  1437.     set Error = $($R0)
  1438.     goto fatal
  1439. ;
  1440. ; fatal error display
  1441. ;
  1442. fatal = +
  1443.     Debug-Output "At fatal"
  1444.     ifstr(i) $(Error) == ""
  1445.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1446.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1447.         goto ShellCodeError
  1448.     endif
  1449.     set Error = $($R0)
  1450.     endif
  1451.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1452.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1453.     goto ShellCodeError
  1454.     endif
  1455.  
  1456.     goto setfailed
  1457.  
  1458. ;
  1459. ;  Shelling error
  1460. ;
  1461. ShellCodeError = +
  1462.     Debug-Output "At ShellCodeError"
  1463.     set DlgType      = "MessageBox"
  1464.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1465.     set STF_MB_TEXT  = "Shell Code Error"
  1466.     set STF_MB_TYPE  = 1
  1467.     set STF_MB_ICON  = 3
  1468.     set STF_MB_DEF   = 1
  1469.     ui start "Error Message"
  1470.     goto setfailed
  1471.  
  1472. setfailed = +
  1473.     Debug-Output "At setfailed"
  1474.     set CommonStatus = STATUS_FAILED
  1475.     ;
  1476.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1477.     ;
  1478.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1479.     set OEM_ABANDON_ON = FALSE
  1480.     goto abandon
  1481.     endif
  1482.     goto end
  1483.  
  1484. end = +
  1485.     Debug-Output "At end"
  1486.     goto term
  1487.  
  1488. term = +
  1489.     Debug-Output "At term"
  1490.     Return $(CommonStatus)
  1491.  
  1492.  
  1493. [DebugConfiguration]
  1494.     return
  1495.  
  1496.  
  1497. ;***************************************************************
  1498. ;  INSTALL SECTIONS
  1499. ;***************************************************************
  1500. [Install-Option]
  1501.     Debug-Output "At Install-Option"
  1502.     set STF_VITAL = ""
  1503.  
  1504.     ifstr(i) $(AddCopy) == "YES"
  1505.  
  1506.  
  1507.     ;
  1508.     ; Add the files to the copy list
  1509.     ;
  1510.     ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1511.     ;      the other INF files
  1512.     ;
  1513.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1514.     Debug-Output "AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers"
  1515.     AddSectionFilesToCopyList Files-AUX $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1516.     Debug-Output "AddSectionFilesToCopyList Files-AUX $(SrcDir) $(!STF_WINDOWSSYSPATH)"
  1517.     Debug-Output "##########################"
  1518.  
  1519.     endif
  1520.  
  1521.     ifstr(i) $(DoCopy) == "YES"
  1522.  
  1523.     Debug-Output "CopyFilesInCopyList"
  1524.  
  1525.     ;
  1526.     ; Copy files in the copy list
  1527.     ;
  1528.     set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1529.     CopyFilesInCopyList
  1530. ;NT 4.0 start
  1531.     else
  1532.     ifcontains(i) $(m_WinNTVersion) not-in {"3.50", "3.51"}
  1533.        ; WinNT 4.x
  1534.        LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\FL32NT.DLL $(!STF_WINDOWSSYSPATH)\FL32NT.DLL
  1535.        LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\FL32NT.HLP $(!STF_WINDOWSSYSPATH)\FL32NT.HLP
  1536.        endif
  1537. ;NT 4.0 end
  1538.    endif
  1539.  
  1540.     Exit
  1541.  
  1542. [Install-Update]
  1543.     Debug-Output "At Install-Update"
  1544.    set STF_VITAL        = ""
  1545.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1546.    ;set STF_VERSION     = "YES"
  1547.  
  1548.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1549.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1550.  
  1551.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1552.    CopyFilesInCopyList
  1553.  
  1554.    exit
  1555.  
  1556. [IsFL32CardAlreadyInstalled]
  1557.     read-syms InitBaseVars
  1558.     set AlreadyExisted  = "NO"
  1559.     set BusNum  = $($0)
  1560.     set SlotNum = $($1)
  1561.     set Description = $($2)
  1562.     set Product = $($3)
  1563.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
  1564.     Ifstr $(IE_KeyNetcards) == $(KeyNull)
  1565.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1566.        goto IE_Return
  1567.     endif
  1568.     EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  1569.     ForListDo  $(IE_KeyNameList)
  1570.     set IE_KeyName = *($($),1)
  1571.     OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
  1572.     Ifstr $(IE_Card) == $(KeyNull)
  1573.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1574.        goto IE_Return
  1575.     endif
  1576.     GetRegValue $(IE_Card),"Description", DescriptionInfo
  1577.     GetRegValue $(IE_Card),"ProductName", ProductNameInfo
  1578.     set CardDescription     = *($(DescriptionInfo), 4)
  1579.     set CardProductName     = *($(ProductNameInfo), 4)
  1580.     ifstr(i) $(CardDescription) == $(Description)
  1581.         ifstr(i) $(CardProductName) == $(Product)
  1582.         GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
  1583.         set ServiceName = *($(ServiceNameInfo), 4)
  1584.         OpenRegKey $(!REG_H_LOCAL) "" +
  1585.            $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
  1586.            $(MAXIMUM_ALLOWED) IE_KeyService
  1587.         Ifstr $(IE_KeyService) == $(KeyNull)
  1588.            set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1589.            goto IE_Return
  1590.         endif
  1591.         GetRegValue $(IE_KeyService), "BusNumber", BusInfo
  1592.         GetRegValue $(IE_KeyService), "Slot", SlotInfo
  1593.         set CardBusNum = *($(BusInfo), 4)
  1594.         set CardSlotNum = *($(SlotInfo), 4)
  1595.         ifint $(CardBusNum) == $(BusNum)
  1596.             ifint $(CardSlotNum) == $(SlotNum)
  1597.             set AlreadyExisted = "YES"
  1598.             endif
  1599.         endif
  1600.         endif
  1601.     endif
  1602.     EndForListDo
  1603. IE_Return = +
  1604.     return $(RegistryErrorIndex) $(AlreadyExisted)
  1605.  
  1606. [InitBaseVars]
  1607. KeyNull            = ""
  1608. MAXIMUM_ALLOWED    = 33554432
  1609. KeyInfo            = {}
  1610. RegistryErrorIndex = NO_ERROR
  1611. NoTitle            = 0
  1612. CurrentControlSet  = "SYSTEM\CurrentControlSet"
  1613. ServicesBaseName   = $(CurrentControlSet)"\Services"
  1614. NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  1615. !RegLastError      = NO_ERROR
  1616. [RegistryErrorSetup]
  1617. RegistryErrorIndex = ^(RegistryErrors$(!STF_LANGUAGE),1)
  1618. RegistryErrorList = ^(RegistryErrors$(!STF_LANGUAGE),2)
  1619.